package cn.ac.cintcm.dataconverge.researcher.service.impl;

import java.util.List;

import com.hs.core.page.PageParam;
import com.hs.core.page.PageUtil;
import com.hs.core.service.BaseSevice;

import cn.ac.cintcm.dataconverge.dao.IBaseDao;
import cn.ac.cintcm.dataconverge.researcher.dao.IDepartmentDao;
import cn.ac.cintcm.dataconverge.researcher.domain.Department;
import cn.ac.cintcm.dataconverge.researcher.service.IDepartmentService;

public class DepartmentService extends BaseSevice implements IDepartmentService{

	private IDepartmentDao departmentDao;
	
	public IDepartmentDao getDepartmentDao() {
		return departmentDao;
	}

	public void setDepartmentDao(IDepartmentDao departmentDao) {
		this.departmentDao = departmentDao;
	}

	public List listDepartments() {
		return departmentDao.listDepartments();
	}

	public Department getDepartmentById(Long id){
		return departmentDao.getDepartmentById(id);
	}

	public boolean saveDepartment(Department department) {
		// TODO Auto-generated method stub
		departmentDao.save(department);
		return true;
	}

	public boolean deleteDepartment(Long id) {
		// TODO Auto-generated method stub
		departmentDao.delete(departmentDao.getDepartmentById(id));
		return true;
	}

	public List getDepartmentsIdByOrg(Long orgId) {
		// TODO Auto-generated method stub
		return departmentDao.getDepartmentsIdByOrg(orgId);
	}

	public List getDepartmentsByOrg(Long org) {
		// TODO Auto-generated method stub
		return departmentDao.getDepartmentsByOrg(org);
	}

	@Override
	public IBaseDao getBaseDao() {
		// TODO Auto-generated method stub
		return departmentDao;
	}

	public PageUtil listDepartmentsPage(PageParam pageParam,Long id) {
		// TODO Auto-generated method stub
		return departmentDao.listDepartmentsPage(pageParam, id);
	}

}
